/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.blog.wordpress.entities.managedbeans;

import com.blog.wordpress.entities.RegisteredUser;
import com.blog.wordpress.sessionbeans.RegisteredUserFacadeLocal;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

/**
 *
 * @author Breath
 */
@ManagedBean
@RequestScoped
public class RegistrationBean {

    RegisteredUser registeredUser = new RegisteredUser();
    @EJB
    RegisteredUserFacadeLocal registeredFacade;

    public RegisteredUser getRegisteredUser() {
        return registeredUser;
    }

    public void setRegisteredUser(RegisteredUser registeredUser) {
        this.registeredUser = registeredUser;
    }

    public String persistRegisteredUser() {
        if (registeredUser != null) {
            registeredFacade.create(registeredUser);
        }
        return "showRegMenu";
    }
}
